Paul Hockett,
13/05/22 v2
Looking at MCFs - quick comparison plot at bottom of page).
Data files from expt.(from Felix, 26/01/22): experimentally extracted DCS from one of our datasets, assuming a Up of 37.5eV and three different return energies of 1.2Up, 1.6Up, and 2.0Up, corresponding to scattering energies of 45eV, 60eV, and 75eV, respectively.
Data files for atomic scattering (from Felix, 26/01/22): ELESPA calculations for the C and H atoms and the three relevant energies. The columns are: scattering angle | real part of C scattering amplitude | imaginary part of C scattering amplitude | real part of H scattering amplitude | imaginary part of H scattering amplitude.
07/03/22 v1
Based on "EDCS $N_2$ Tests", 27/09/19, ePSproc_EDCS_N2_multiE_270919_dist.ipynb, see https://osf.io/nhdkf/
Basic read + plot for EDCS data using epsproc & Xarray.
(Note that only the dev brach of epsproc currently has the EDCS IO code required here.)
import sys
import os
import numpy as np
# For module testing, include path to local module code here
# modPath = r'/home/femtolab/github/ePSproc/'
# sys.path.append(modPath)
import epsproc as ep
* sparse not found, sparse matrix forms not available. * natsort not found, some sorting functions not available.
* Setting plotter defaults with epsproc.basicPlotters.setPlotters(). Run directly to modify, or change options in local env.
* Set Holoviews with bokeh. * pyevtk not found, VTK export not available.
# Load data from modPath\data\filename
# dataPath = r'/home/femtolab/python/remote/N2_tests/'
# dataPath = '/home/paul/ePS/butadiene_2022/EDCSmultiE/orb15_BG/' # Jake
dataPath = '/home/jovyan/projects/butadiene_2022/EDCSmultiE/orb15_BG/' # Docker hub version
# Scan file(s), return list of Xarrays, one per file.
dataSet = ep.readMatEle(fileBase = dataPath, recordType = 'EDCS') #, verbose = 3)
*** ePSproc readMatEle(): scanning files for EDCS segments. *** Scanning dir /home/jovyan/projects/butadiene_2022/EDCSmultiE/orb15_BG/ Found 1 .out file(s) *** FileListSort Prefix: /home/jovyan/projects/butadiene_2022/EDCSmultiE/orb15_BG/EDCSmultiE.orb15_BG_E10.0_10.0_150.0eV.inp.out 1 groups. *** Reading ePS output file: /home/jovyan/projects/butadiene_2022/EDCSmultiE/orb15_BG/EDCSmultiE.orb15_BG_E10.0_10.0_150.0eV.inp.out *** IO.fileParse() found 15 segments with Start: EDCS - differential cross section program End: ['+ Command', 'Time Now']. Found 15 EDCS segments (sets of scattering results). Processed 15 sets of EDCS file segments, (0 blank)
dataSet[0]
<xarray.DataArray 'EDCSmultiE.orb15_BG_E10.0_10.0_150.0eV.inp.out' (E: 15,
Theta: 181)>
array([[63.93985371, 63.8110057 , 63.45002065, ..., 6.95269485,
6.97096627, 6.97712315],
[51.52385444, 51.35672026, 50.88299083, ..., 3.72899855,
3.7394363 , 3.74294313],
[42.7882299 , 42.60659223, 42.09136968, ..., 2.13514837,
2.1383263 , 2.13940185],
...,
[41.74359381, 41.17254616, 39.54604995, ..., 0.22012939,
0.22067681, 0.22087297],
[42.04002232, 41.42681345, 39.6826238 , ..., 0.20344531,
0.20398371, 0.20417674],
[42.44299553, 41.78602282, 39.91994352, ..., 0.18138531,
0.18187093, 0.1820448 ]])
Coordinates:
* E (E) float64 10.0 20.0 30.0 40.0 50.0 ... 120.0 130.0 140.0 150.0
* Theta (Theta) float64 0.0 1.0 2.0 3.0 4.0 ... 177.0 178.0 179.0 180.0
Attributes:
dataType: EDCS
units: Angs^2
file: EDCSmultiE.orb15_BG_E10.0_10.0_150.0eV.inp.out
fileBase: /home/jovyan/projects/butadiene_2022/EDCSmultiE/orb15_BG
fileList: EDCSmultiE.orb15_BG_E10.0_10.0_150.0eV.inp.outNote plots are interactive - mouse-over for details.
# Full map
# ep.plot.hvPlotters.curvePlot(dataSet[0], kdims = 'Theta');
dataSet[0].hvplot() #.hvPlotters.curvePlot(dataSet[0], kdims = 'Theta');
WARNING:param.RasterPlot02478: Due to internal constraints, when aspect and width/height is set, the bokeh backend uses those values as frame_width/frame_height instead. This ensures the aspect is respected, but means that the plot might be slightly larger than anticipated. Set the frame_width/frame_height explicitly to suppress this warning.
# Line outs with widget
dataSet[0].hvplot.line(width=1000)
# Line outs with overlay
# dataSet[0].pipe(np.log10).hvplot.line(width=1000, legend = 'left').overlay('E') # Legend postion not working?
dataSet[0].hvplot.line(width=1000, xlim=[0, 220]).overlay('E') # Add padding!
# Full map, log10 scaling
# ep.plot.hvPlotters.curvePlot(dataSet[0], kdims = 'Theta');
dataSet[0].pipe(np.log10).hvplot()
WARNING:param.RasterPlot07081: Due to internal constraints, when aspect and width/height is set, the bokeh backend uses those values as frame_width/frame_height instead. This ensures the aspect is respected, but means that the plot might be slightly larger than anticipated. Set the frame_width/frame_height explicitly to suppress this warning.
# Line outs with widget
dataSet[0].pipe(np.log10).hvplot.line(width=1000)
# Line outs with overlay
# ep.plot.hvPlotters.curvePlot(dataSet[0], kdims = 'Theta');
# dataSet[0].pipe(np.log10).hvplot.line(width=1000, legend = 'left').overlay('E') # Legend postion not working?
dataSet[0].pipe(np.log10).hvplot.line(width=1000, xlim=[0, 220]).overlay('E') # Add padding!
Following eqn. 2 in Ito et. al.
$MCF = (\sigma - \sigma_{A})/\sigma_{A}$
Where $\sigma_{A}$ is the (incoherent) sum of the atomic DCSs.
Ito, Y. et al. (2017) ‘Extraction of geometrical structure of ethylene molecules by laser-induced electron diffraction combined with ab initio scattering calculations’, Physical Review A, 96(5), p. 053414. doi:10.1103/PhysRevA.96.053414.
Data files for atomic scattering (from Felix, 26/01/22): ELESPA calculations for the C and H atoms and the three relevant energies. The columns are: scattering angle | real part of C scattering amplitude | imaginary part of C scattering amplitude | real part of H scattering amplitude | imaginary part of H scattering amplitude.
atomicDataPath = '/home/jovyan/projects/butadiene_2022/DCS_MCF_proc_May_2022/expt-DCS_ELESPA_atomic_data/' # Docker hub version
import glob
dataFileList = glob.glob(atomicDataPath + '**')
# Set for ELESPA data
fileInds = slice(3,6)
dataFileList[fileInds]
# fileInds
['/home/jovyan/projects/butadiene_2022/DCS_MCF_proc_May_2022/expt-DCS_ELESPA_atomic_data/DCS_theory_C_H_45.dat', '/home/jovyan/projects/butadiene_2022/DCS_MCF_proc_May_2022/expt-DCS_ELESPA_atomic_data/DCS_theory_C_H_60.dat', '/home/jovyan/projects/butadiene_2022/DCS_MCF_proc_May_2022/expt-DCS_ELESPA_atomic_data/DCS_theory_C_H_75.dat']
# Set indexes
# Grab Elist - should use parselinedigits regex here!
Elist = [int(item.split('_')[-1].split('.')[0]) for item in dataFileList[fileInds]]
Elist
# Set multindex for PD columns
cols = pd.MultiIndex.from_product([Elist,['C','H']])
cols
MultiIndex([(45, 'C'),
(45, 'H'),
(60, 'C'),
(60, 'H'),
(75, 'C'),
(75, 'H')],
)
# Easiest to read with Numpy or Pandas, then push to Xr?
import pandas as pd
# This almost works, but seems to have issue with space vs. tab seperated files?
# testList = [pd.read_csv(fIn, header=None, names=['Re','Im'], sep='\s+') for fIn in dataFileList[0:3]]
testList = [pd.read_csv(fIn, header=None, index_col = [0], delim_whitespace=True) for fIn in dataFileList[fileInds]]
# testXR = [pd.read_csv(fIn, header=None, names=['Re','Im'], sep='\s+').to_xarray() for fIn in dataFileList[fileInds]]
# test
# Sort-of works, but need to force/set dims first
# E.g. cell 13 https://phockett.github.io/ePSdata/XeF2-preliminary/xe-xef2_comp_120221-dist.html
# import xarray as xr
# xrData = xr.concat(testXR, dim = 'E')
# Try restacking from PD
reformat = [pd.DataFrame([item[1] + item[2]*1j, item[3] + item[4]*1j]).T for item in testList]
# TODO tidy index, e.g. np.round(reformat[0].index,3)
# [item.set_index(np.round(item.index,0), inplace=True) for item in reformat] # Tidy up index & round to nearest degree (to match ePS case, although interp might be better)
# Set multindex
# pd.MultiIndex.from_product(['C','H'],)
pdData = pd.concat(reformat, axis=1) #, names = dataFileList[0:3])
# pdData.columns = dataFileList[0:3] # Full paths at the moment - needs to tidy!
# pdData.columns = [item.split('/')[-1].split('_')[-2] for item in dataFileList[fileInds]] # Quick and dirty enery settings
# pdData.to_xarray() # OK
pdData.index.rename('Theta', inplace=True)
# pdData.rename(columns={'Eret1p2':45, 'Eret1p6':60, 'Eret2p0':75}, inplace=True) # Set energies from Up
# pdData.rename(columns={0:'C',1:'H'}, inplace=True)
pdData.columns = cols
pdData # Show table
| 45 | 60 | 75 | ||||
|---|---|---|---|---|---|---|
| C | H | C | H | C | H | |
| Theta | ||||||
| 0.000000 | 1.255280e-08+1.383240e-08j | 6.338500e-09+2.279280e-09j | 1.366940e-08+1.305570e-08j | 6.143260e-09+1.870990e-09j | 1.442830e-08+1.254110e-08j | 6.007380e-09+1.612820e-09j |
| 0.000100 | 1.255280e-08+1.383240e-08j | 6.338500e-09+2.279280e-09j | 1.366940e-08+1.305570e-08j | 6.143260e-09+1.870990e-09j | 1.442830e-08+1.254110e-08j | 6.007380e-09+1.612820e-09j |
| 0.000125 | 1.255280e-08+1.383240e-08j | 6.338500e-09+2.279280e-09j | 1.366940e-08+1.305570e-08j | 6.143260e-09+1.870990e-09j | 1.442830e-08+1.254110e-08j | 6.007380e-09+1.612820e-09j |
| 0.000150 | 1.255280e-08+1.383240e-08j | 6.338500e-09+2.279280e-09j | 1.366940e-08+1.305570e-08j | 6.143260e-09+1.870990e-09j | 1.442830e-08+1.254110e-08j | 6.007380e-09+1.612820e-09j |
| 0.000175 | 1.255280e-08+1.383240e-08j | 6.338500e-09+2.279280e-09j | 1.366940e-08+1.305570e-08j | 6.143260e-09+1.870990e-09j | 1.442830e-08+1.254110e-08j | 6.007380e-09+1.612820e-09j |
| ... | ... | ... | ... | ... | ... | ... |
| 178.000000 | 6.641090e-09-4.440460e-09j | 1.113070e-10+9.907340e-10j | 4.722510e-09-3.819200e-09j | 1.398190e-10+7.038480e-10j | 3.396300e-09-3.367850e-09j | 1.451210e-10+5.384350e-10j |
| 178.500000 | 6.643560e-09-4.440270e-09j | 1.112030e-10+9.906440e-10j | 4.724250e-09-3.818860e-09j | 1.397450e-10+7.037790e-10j | 3.397570e-09-3.367520e-09j | 1.450650e-10+5.383810e-10j |
| 179.000000 | 6.645320e-09-4.440140e-09j | 1.111290e-10+9.905790e-10j | 4.725480e-09-3.818630e-09j | 1.396930e-10+7.037300e-10j | 3.398470e-09-3.367290e-09j | 1.450250e-10+5.383420e-10j |
| 179.500000 | 6.646380e-09-4.440060e-09j | 1.110850e-10+9.905400e-10j | 4.726230e-09-3.818480e-09j | 1.396620e-10+7.037010e-10j | 3.399010e-09-3.367150e-09j | 1.450010e-10+5.383190e-10j |
| 180.000000 | 6.646730e-09-4.440040e-09j | 1.110700e-10+9.905270e-10j | 4.726480e-09-3.818440e-09j | 1.396510e-10+7.036910e-10j | 3.399190e-09-3.367100e-09j | 1.449930e-10+5.383110e-10j |
606 rows × 6 columns
# Need to concat with control here... this currently gives 6 das
# atomicData = pdData.to_xarray() # Dataset
# Use UNSTACK of course...
atomicData = pdData.unstack().to_xarray().rename({'level_0':'E','level_1':'species'})
atomicData
<xarray.DataArray (E: 3, species: 2, Theta: 606)>
array([[[1.25528e-08+1.38324e-08j, 1.25528e-08+1.38324e-08j,
1.25528e-08+1.38324e-08j, ..., 6.64532e-09-4.44014e-09j,
6.64638e-09-4.44006e-09j, 6.64673e-09-4.44004e-09j],
[6.33850e-09+2.27928e-09j, 6.33850e-09+2.27928e-09j,
6.33850e-09+2.27928e-09j, ..., 1.11129e-10+9.90579e-10j,
1.11085e-10+9.90540e-10j, 1.11070e-10+9.90527e-10j]],
[[1.36694e-08+1.30557e-08j, 1.36694e-08+1.30557e-08j,
1.36694e-08+1.30557e-08j, ..., 4.72548e-09-3.81863e-09j,
4.72623e-09-3.81848e-09j, 4.72648e-09-3.81844e-09j],
[6.14326e-09+1.87099e-09j, 6.14326e-09+1.87099e-09j,
6.14326e-09+1.87099e-09j, ..., 1.39693e-10+7.03730e-10j,
1.39662e-10+7.03701e-10j, 1.39651e-10+7.03691e-10j]],
[[1.44283e-08+1.25411e-08j, 1.44283e-08+1.25411e-08j,
1.44283e-08+1.25411e-08j, ..., 3.39847e-09-3.36729e-09j,
3.39901e-09-3.36715e-09j, 3.39919e-09-3.36710e-09j],
[6.00738e-09+1.61282e-09j, 6.00738e-09+1.61282e-09j,
6.00738e-09+1.61282e-09j, ..., 1.45025e-10+5.38342e-10j,
1.45001e-10+5.38319e-10j, 1.44993e-10+5.38311e-10j]]])
Coordinates:
* E (E) int64 45 60 75
* species (species) object 'C' 'H'
* Theta (Theta) float64 0.0 0.0001 0.000125 0.00015 ... 179.0 179.5 180.0# atomicData.pipe(np.abs).hvplot.line(x='Theta').overlay('E').layout('species') # Abs
(atomicData.real.hvplot.line(x='Theta').overlay('E').layout('species') + atomicData.imag.hvplot.line(x='Theta').overlay('E').layout('species')).cols(1) # Re + Imag
TODO: these are amplitudes, so need to abs^2 and maybe renorm to match ePS DCS (angs^2).
# atomicData.pipe(np.abs).pipe(np.power,2).pipe(np.divide,(1E-10)**2).hvplot.line(x='Theta').overlay('E').layout('species') # Units x1000 compared to ePS?
# atomicData.pipe(np.abs).pipe(np.power,2).pipe(np.divide,1E-16).hvplot.line(x='Theta').overlay('E').layout('species') # Units similar magnitudes to ePS?
atomicData.pipe(np.power,2).pipe(np.divide,1E-16).pipe(np.abs).hvplot.line(x='Theta').overlay('E').layout('species') # Ordering might matter for coherent/incoherent results.
# atomicData.pipe(np.abs).pipe(np.power,2).hvplot.line(x='Theta').overlay('E').layout('species') # Base units give ~1E-16, likely cm^2?
# Q: scaling/normalisation here? Should expect similar magnitudes to ePS case?
# If ELESPA in cm^2, get values 0-10 angs^2, maybe OK or a bit small?
# Do a quick and dirty interp for 5eV values - should be OK as not massive changes here, but ultimately should run higher-resolution ePS Eke scan.
epsInterp = dataSet[0].sel(E=slice(35,85)).interp(E = np.arange(35,85,5), method = 'cubic')
epsInterp.hvplot.line(x='Theta').overlay('E') + dataSet[0].sel(E=slice(35,85)).hvplot.line(x='Theta').overlay('E')
# Run setPlotDefault for size etc.
from epsproc.plot import hvPlotters
hvPlotters.setPlotDefaults(fSize = [1000, 400])
# Calculate MCS
# Square & rescale atomic data to angs^2
# Sum over scatterers (incoherent)
# Don't change Theta coords - Xarray should take care of that...? Should be OK as long as enough matching points (more angles in ELESPA outputs)
sigmaAtomic = atomicData.pipe(np.power,2).pipe(np.divide,1E-16).pipe(np.abs) # Convert to XS in angs^2
MCS = (epsInterp - sigmaAtomic.sum('species'))/sigmaAtomic.sum('species')
MCS.hvplot.line(x='Theta').overlay('E')
MCS
<xarray.DataArray (E: 3, Theta: 181)>
array([[9.241923 , 9.19379608, 9.05756297, 8.85374951, 8.60630497,
8.3322935 , 8.03587349, 7.70865908, 7.3362062 , 6.90716725,
6.42049457, 5.8880482 , 5.33192757, 4.77904523, 4.25480645,
3.77900209, 3.36389217, 3.01388064, 2.72676506, 2.49460847,
2.3055319 , 2.14570434, 2.00220804, 1.86569344, 1.731766 ,
1.60105234, 1.4773778 , 1.36517536, 1.26753371, 1.18496259,
1.11569025, 1.05677232, 1.00513419, 0.95876281, 0.9171346 ,
0.88147718, 0.85432388, 0.8387526 , 0.83725688, 0.85064611,
0.87748595, 0.9144142 , 0.95722223, 1.00225176, 1.04742856,
1.09246216, 1.13834255, 1.18637986, 1.23743418, 1.29147392,
1.34759078, 1.40429714, 1.46001992, 1.51366389, 1.56517545,
1.61585628, 1.66818785, 1.72512581, 1.78903654, 1.86093708,
1.94019179, 2.02515038, 2.11403678, 2.20580442, 2.30051221,
2.39913264, 2.50314524, 2.61411136, 2.73337542, 2.86192292,
3.00027648, 3.14874851, 3.30755731, 3.47754432, 3.66046719,
3.85867087, 4.07434405, 4.30809206, 4.55819455, 4.82042901,
5.08903324, 5.35794887, 5.62193459, 5.87699803, 6.12016961,
6.34881941, 6.55990055, 6.74921472, 6.91044468, 7.03566255,
7.11587227, 7.14302849, 7.11246815, 7.02397307, 6.88225415,
6.69557266, 6.47401223, 6.22758969, 5.96489432, 5.69300498,
...
2.95670341, 2.87536218, 2.80912429, 2.75590141, 2.7120533 ,
2.67352755, 2.6369628 , 2.6007203 , 2.56515614, 2.53194068,
2.50301205, 2.47951186, 2.46121908, 2.44685025, 2.43456408,
2.42259967, 2.40966317, 2.39500332, 2.3784116 , 2.36034253,
2.34164622, 2.32338698, 2.30638706, 2.29088592, 2.27655798,
2.26277673, 2.2489606 , 2.23486862, 2.22042698, 2.20554496,
2.1899204 , 2.17313553, 2.15484788, 2.13495113, 2.11360749,
2.09109145, 2.06766469, 2.04349885, 2.01886362, 1.99404066,
1.96935719, 1.94491636, 1.9205921 , 1.89608742, 1.87122605,
1.84619222, 1.8215942 , 1.79816743, 1.77659714, 1.75721217,
1.74015059, 1.72531996, 1.71261497, 1.70182097, 1.69256663,
1.6843675 , 1.67679127, 1.6696925 , 1.6632775 , 1.65799046,
1.65421317, 1.65208616, 1.65147095, 1.65210711, 1.65386689,
1.65680545, 1.66103889, 1.66660702, 1.67345166, 1.6815784 ,
1.69120789, 1.7027736 , 1.71673788, 1.73328982, 1.75230116,
1.77338055, 1.79627729, 1.82102285, 1.84794564, 1.87731192,
1.9090641 , 1.94280063, 1.97792446, 2.01401468, 2.0508638 ,
2.08834173, 2.12598558, 2.16287594, 2.19774577, 2.22936688,
2.25693661, 2.28007223, 2.29864881, 2.31245383, 2.32103758,
2.32397026]])
Coordinates:
* Theta (Theta) float64 0.0 1.0 2.0 3.0 4.0 ... 177.0 178.0 179.0 180.0
* E (E) int64 45 60 75Data files from expt.(from Felix, 26/01/22): experimentally extracted DCS from one of our datasets, assuming a Up of 37.5eV and three different return energies of 1.2Up, 1.6Up, and 2.0Up, corresponding to scattering energies of 45eV, 60eV, and 75eV, respectively.
fileInds = slice(0,3)
dataFileList[fileInds]
# fileInds
['/home/jovyan/projects/butadiene_2022/DCS_MCF_proc_May_2022/expt-DCS_ELESPA_atomic_data/210107_exp_D0_Eret1p2_Up37p5.dat', '/home/jovyan/projects/butadiene_2022/DCS_MCF_proc_May_2022/expt-DCS_ELESPA_atomic_data/210107_exp_D0_Eret1p6_Up37p5.dat', '/home/jovyan/projects/butadiene_2022/DCS_MCF_proc_May_2022/expt-DCS_ELESPA_atomic_data/210107_exp_D0_Eret2p0_Up37p5.dat']
# Easiest to read with Numpy or Pandas, then push to Xr?
import pandas as pd
# This almost works, but seems to have issue with space vs. tab seperated files?
# testList = [pd.read_csv(fIn, header=None, names=['Re','Im'], sep='\s+') for fIn in dataFileList[0:3]]
testList = [pd.read_csv(fIn, header=None, names=['Re','Im'],delim_whitespace=True) for fIn in dataFileList[fileInds]]
testXR = [pd.read_csv(fIn, header=None, names=['Re','Im'], sep='\s+').to_xarray() for fIn in dataFileList[fileInds]]
# test
# Sort-of works, but need to force/set dims first
# E.g. cell 13 https://phockett.github.io/ePSdata/XeF2-preliminary/xe-xef2_comp_120221-dist.html
# import xarray as xr
# xrData = xr.concat(testXR, dim = 'E')
# Try restacking from PD
reformat = [pd.DataFrame(item['Re'] + item['Im']*1j) for item in testList]
# TODO tidy index, e.g. np.round(reformat[0].index,3)
[item.set_index(np.round(item.index,0), inplace=True) for item in reformat] # Tidy up index & round to nearest degree (to match ePS case, although interp might be better)
pdData = pd.concat(reformat, axis=1) #, names = dataFileList[0:3])
# pdData.columns = dataFileList[0:3] # Full paths at the moment - needs to tidy!
pdData.columns = [item.split('/')[-1].split('_')[-2] for item in dataFileList[fileInds]] # Quick and dirty enery settings
# pdData.to_xarray() # OK
pdData.index.rename('Theta', inplace=True)
pdData.rename(columns={'Eret1p2':45, 'Eret1p6':60, 'Eret2p0':75}, inplace=True) # Set energies from Up
pdData # Show table
| 45 | 60 | 75 | |
|---|---|---|---|
| Theta | |||
| 1.0 | 0.000000+0.000000j | 0.0000000+0.0000000j | 0.000000+0.000000j |
| 2.0 | 0.000000+0.000000j | 0.0000000+0.0000000j | 0.000000+0.000000j |
| 3.0 | 0.000000+0.000000j | 0.0000000+0.0000000j | 0.000000+0.000000j |
| 4.0 | 0.000000+0.000000j | 0.0000000+0.0000000j | 0.000000+0.000000j |
| 5.0 | 0.000000+0.000000j | 0.0000000+0.0000000j | 0.000000+0.000000j |
| ... | ... | ... | ... |
| 176.0 | 448.68140+55.12950j | 168.412120+31.832830j | 83.77806+20.52115j |
| 177.0 | 452.79170+58.78483j | 209.359720+40.423974j | 53.27593+17.85868j |
| 178.0 | 525.33100+73.77291j | 226.295900+47.872022j | 76.69515+23.49546j |
| 179.0 | 639.52080+95.98866j | 247.829700+56.554400j | 201.85810+48.23733j |
| 180.0 | 581.5425+115.8601j | 236.015000+63.990280j | 208.95260+62.50720j |
179 rows × 3 columns
# pdData.to_xarray().real.hvplot() # Working for dataset for string col headers, but not ints?
expData = pdData.to_xarray().to_array().rename({'variable':'E'})
expData.pipe(np.abs).hvplot.line(x='Theta').overlay('E') # Abs
(expData.real.hvplot.line(x='Theta').overlay('E') + expData.imag.hvplot.line(x='Theta').overlay('E')).cols(1)
expData.pipe(np.power,2).pipe(np.abs).hvplot.line(x='Theta').overlay('E')
As above, but with scale factor for exp data. Should also be squared?
# Assume DCS - this looks interesting
SF = 1E-3 # Basic order-of-magnitude scaling looks pretty good! # 4*7E-3 # SF should be E dependent? ALSO, most of the structure from the division, not subtraction.
# SF = 1E-1 * 1/MCSexp.max('Theta') # E-dependent renorm
MCSexp = (SF*expData.pipe(np.abs) - sigmaAtomic.sum('species'))/sigmaAtomic.sum('species')
# Squared? Less good?
# SF = 6E-7
# MCSexp = (SF*expData.pipe(np.power,2).pipe(np.abs) - sigmaAtomic.sum('species'))/sigmaAtomic.sum('species')
# Plot
MCSexp.hvplot.line(x='Theta').overlay('E')
# Basic renorm
# SFexp = 1/MCSexp.max('Theta') # E-dependent renorm
# SF = 1/MCS.max('Theta') # E-dependent renorm
# Rescale to expt
SFexp = 1
SF = MCSexp.max('Theta') * 1/MCS.where(MCS.Theta>30).max('Theta') # E-dependent renorm, exclude low theta
# (MCSexp*SFexp).hvplot.line(x='Theta').overlay('E') * (MCS*SF).hvplot.line(x='Theta', line_dash='dashed').overlay('E')
(MCSexp*SFexp).hvplot.scatter(x='Theta', marker = 'x', height=600).overlay('E') * (MCS*SF).hvplot.line(x='Theta', line_dash='solid').overlay('E')
!hostname
e6a89eee5683
import scooby
scooby.Report(additional=['epsproc', 'holoviews', 'hvplot', 'xarray', 'matplotlib', 'bokeh'])
| Fri May 13 21:45:34 2022 UTC | |||||||
| OS | Linux | CPU(s) | 4 | Machine | x86_64 | Architecture | 64bit |
| RAM | 7.8 GiB | Environment | Jupyter | File system | btrfs | ||
| Python 3.9.5 | packaged by conda-forge | (default, Jun 19 2021, 00:32:32) [GCC 9.3.0] | |||||||
| epsproc | 1.3.1-dev | holoviews | 1.14.8 | hvplot | 0.8.0 | xarray | 2022.3.0 |
| matplotlib | 3.4.2 | bokeh | 2.3.3 | numpy | 1.21.0 | scipy | 1.7.0 |
| IPython | 7.25.0 | scooby | 0.5.12 | ||||
# Check current Git commit for local ePSproc version
from pathlib import Path
!git -C {Path(ep.__file__).parent} branch
!git -C {Path(ep.__file__).parent} log --format="%H" -n 1
* dev
361f5822734f83b771c38aa740d99bd7140310aa
# Check current remote commits
!git ls-remote --heads git://github.com/phockett/ePSproc
fatal: unable to connect to github.com: github.com[0: 140.82.113.3]: errno=Connection timed out